﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DAO;
using System.Data;
namespace BUS
{
   public  class BangGiaVeBUS
    {
       public void CapNhatSoCho(string mave)
       {
           BangGiaVeDAO dao = new BangGiaVeDAO();
           VeMayBayDAO dao1 = new VeMayBayDAO();
           string maChuyenBay = "";
           int loaiVe = 1;
           DataTable dt = new DataTable();
           dt = dao1.layThongTinVeBay(mave);
           if (dt != null)
           {
               maChuyenBay = dt.Rows[0]["ID_chuyenBay"].ToString();
               loaiVe = int.Parse(dt.Rows[0]["ID_loaiVe"].ToString());
               dao.CapNhatSoCho(maChuyenBay, loaiVe);
           }
       }
       public float layGiaVe(string maChuyenBay, int loaiVe)
       {
           BangGiaVeDAO dao = new BangGiaVeDAO();
           return dao.layGiaVe(maChuyenBay, loaiVe);
       }
    }
}
